package org.huifei.a1_commonfactory;

/**
 * Created by huifei on 2017/7/11.
 */
public class CommonFactory {

    public Sender produce(String type) {

        if ("mail".equals(type)) {

            return new MailSender();

        } else if ("sms".equals(type)) {

            return new SmsSender();

        } else {

            System.out.println("请输入正确的类型！R");
            return null;

        }
    }

}
